﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _4.SameAndDifferentLines
{
    class SameAndDifferentLines
    {
        static void Main(string[] args)
        {


            StreamReader reader = new StreamReader(@"..\..\SameAndDifferentLines.cs");
                StreamReader reader2 = new StreamReader("..\\..\\Class2.txt");
                using (reader)
                {
                    using (reader2)
                    {
                        
                        int linenumber = 0;
                        string linefile1 = reader.ReadLine();
                        string linefile2 = reader2.ReadLine();
                        while (linefile1 != null)
                        {
                            linenumber++;
                            if (linefile1 == linefile2)
                            {
                                Console.WriteLine("Same line in file1 and file2 on {0} line:",linenumber);
                                Console.WriteLine("In file 1: {0}", linefile1);
                                Console.WriteLine("In file 2: {0}", linefile1);
                            }
                            else
                            {
                                Console.WriteLine("Different line in file1 and file2 on {0} line:", linenumber);
                                Console.WriteLine("In file 1: {0}", linefile1);
                                Console.WriteLine("In file 2: {0}", linefile1);
                            }
                            
                            linefile1 = reader.ReadLine();
                            linefile2 = reader2.ReadLine();
                        }
                    }
                    
                }Console.WriteLine("READY!");
            }
        }
    }